import { compileToFunctions } from "./compiler"
import { initGlobalAPI } from "./globalAPI"
import { initMixin } from "./init"
import { lifecycleMixin } from "./lifecycle"
import { renderMixin } from "./render"
import { initStateMixin } from "./state"

// 将所有方法耦合在一起
function Vue (options) {
  // 默认调用_init
  this._init(options)
}

initMixin(Vue) // 扩展init方法
lifecycleMixin(Vue) // vm._update   vm._render
renderMixin(Vue)
initGlobalAPI(Vue) // 全局API
initStateMixin(Vue) // 实现 nextTick $watch

export default Vue